package cn.smile.commons.constant;

/**
 * @author 10834
 * redis 缓存key
 */
public class RedisKeyConstant {
    /**
     * 用户Token信息([最后一次请求后无操作]7天)
     */
    public static final String USER_TOKEN_KEY = "notebook::userInfo::%s";
    public static final Long USER_TOKEN_TIMEOUT = 604800L;
    /**
     * 写入禁止访问IP地址(20秒)
     */
    public static final String BAN_ACCESS_ADDRESS = "notebook::banAddress";
    public static final Long BAN_ACCESS_ADDRESS_TIMEOUT = 20L;
    /**
     * 忽略鉴权URL(24小时)
     */
    public static final String IGNORE_URLS_KEY = "notebook::ignoreUrls";
    public static final Long IGNORE_URLS_TIMEOUT = 86400L;
    /**
     * 同一IP地址时间段注册数量限制(2小时)
     */
    public static final String USER_REGISTER_KEY = "notebook::register::%s";
    public static final Long USER_REGISTER_TIMEOUT = 7200L;
    /**
     * 同一IP地址登录用户名或密码错误次数(20分钟)
     */
    public static final String SUSPEND_VISIT_IP_NUM_KEY = "notebook::suspendVisit::%s";
    public static final Long SUSPEND_VISIT_IP_NUM_TIMEOUT = 1200L;
    /**
     * 关系绑定时,共享码缓存(5分钟)
     */
    public static final String USER_SHARE_CODE_KEY = "notebook::share::%s";
    public static final Long USER_SHARE_CODE_TIMEOUT = 300L;

    /**
     * 微信公众号授权Token(1小时59分钟[比微信实际少一分钟])
     */
    public static final String WE_CHAT_ACCESS_TOKEN_KEY = "notebook::wechat::accessToken::%s";
    public static final Long WE_CHAT_ACCESS_TOKEN_TIMEOUT = 7140L;
}
